package com.example.rockscissorspapergame.page;

import com.example.rockscissorspapergame.page.slice.MainAbilitySlice;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.ability.IAbilityContinuation;
import ohos.aafwk.content.Intent;
import ohos.aafwk.content.IntentParams;
import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;
import ohos.security.SystemPermission;

public class MainAbility extends Ability implements IAbilityContinuation {

    private static final HiLogLabel LABEL = new HiLogLabel(0, 0x01001, "MainAbility");

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setMainRoute(MainAbilitySlice.class.getName());

        // 向用户申请分布式协同权限
        requestPermissionsFromUser(new String[]{
                SystemPermission.DISTRIBUTED_DATASYNC,}, 0);

    }

    @Override
    public boolean onStartContinuation() {
        HiLog.info(LABEL, "onStartContinuation");
        return true;
    }

    @Override
    public boolean onSaveData(IntentParams intentParams) {
        HiLog.info(LABEL, "onSaveData");
        return true;
    }

    @Override
    public boolean onRestoreData(IntentParams intentParams) {
        HiLog.info(LABEL, "onRestoreData");
        return true;
    }

    @Override
    public void onCompleteContinuation(int i) {
        HiLog.info(LABEL, "onCompleteContinuation");
    }

    @Override
    public void onRemoteTerminated() {
        HiLog.info(LABEL, "onRemoteTerminated");
    }
}